package ym.ecrm.web.action.systemManagement;

import java.util.LinkedList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import ym.ecrm.core.service.systemManagement.ISystemService;
import ym.ecrm.web.action.base.BaseAction;

/**
 * 
 * @author Princess
 * 
 */
public class DeleteUserAction extends BaseAction {

	private String userId;

	@Autowired
	private ISystemService systemService;

	public String execute() {
		if (userId != null) {
			String[] strings = userId.split(",");
			List<Long> list = new LinkedList<Long>();
			for (int i = 0; i < strings.length; i++) {
				list.add(Long.parseLong(strings[i]));
			}
			systemService.deleteUsers(list);
		}
		return proccess();
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public String getSuccess() {
		return success;
	}

}
